package com.cupk.dtos;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
public class RegisterRequest {

    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 20, message = "用户名长度必须在3到20之间")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 40, message = "密码长度必须在6到40之间")
    private String password;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    private String fullName;

    @Size(max = 100, message = "部门名称长度不能超过100个字符")
    private String department; // 部门字段，注册时可选

    @Pattern(regexp = "^$|^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    private String phoneNumber; // 新增手机号码字段，注册时可选

    @NotBlank(message = "验证码不能为空")
    private String verificationCode;
    @Pattern(regexp = "^(ADMIN|RESEARCHER)$", flags = Pattern.Flag.CASE_INSENSITIVE, message = "角色必须是 'ADMIN' 或 'RESEARCHER'")
    private String role = "RESEARCHER"; // 默认值为 RESEARCHER
}